package com.zwj.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zwj.dao.orderdetail.ZOrderDetailMapper;
import com.zwj.entity.ZOrderDetail;
import com.zwj.service.ZOrderDetailService;


@Service
@Transactional
public class ZOrderDetailServiceImpl implements ZOrderDetailService{

	@Autowired
	private ZOrderDetailMapper zOrderDetailMapper;

	//依据order_id查询订单详情
	@Override
	public List<ZOrderDetail> selectAllOrderDetailByorder_id(Integer order_id) {
		List<ZOrderDetail> lod = this.zOrderDetailMapper.selectAllOrderDetailByorder_id(order_id);
		return lod;
	}
	
	//删除订单
	@Override
	public boolean deleteOrderDetail(Integer order_id) {
		boolean result = this.zOrderDetailMapper.deleteOrderDetail(order_id);
		return result;
	}

	
	//查询所有
	@Override
	public List<ZOrderDetail> selectAllOrderDetail() {
		List<ZOrderDetail> lod = this.zOrderDetailMapper.selectAllOrderDetail();
		return lod;
	}

	/*@Override
	public ZOrderDetail selectLikeByName(String buyer_name) {
		// TODO Auto-generated method stub
		return null;
	}*/

	//依据user_id查询
	@Override
	public List<ZOrderDetail> selectAllOrderDetailByuser_id(Integer user_id) {
		List<ZOrderDetail> lod = this.zOrderDetailMapper.selectAllOrderDetailByuser_id(user_id);
		return lod;
	}

	//订单合计
	@Override
	public List<ZOrderDetail> selectTotal() {
		List<ZOrderDetail> lod = this.zOrderDetailMapper.selectTotal();
		return lod;
	}

	@Override
	public int addOrderDetail(ZOrderDetail zOrderDetail) {	
		return this.zOrderDetailMapper.addOrderDetail(zOrderDetail);
	}

	

	
	
	

}
